﻿<%@ Page Language="C#" MasterPageFile="~/Admin/Admin.Master" AutoEventWireup="true"
    CodeBehind="List.aspx.cs" Inherits="Cn.Cellula.Website.Admin.Content.GuestBook.List"
    Title="留言管理" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
    <style type="text/css">
        .gb_content
        {
            padding: 5px 5px 5px 5px;
            white-space: normal;
            text-align: left;
        }
        .gb_content_info
        {
            background-color: #eeeeee;
            border-bottom: 1px solid #aaaaaa;
            height: 24px;
            padding-left: 10px;
            padding-top: 4px;
        }
        .gb_reply
        {
            padding: 5px 15px 5px 15px;
            white-space: normal;
            text-align: left;
            background-color: #ffffc0;
            border: solid 1px #ffcc00;
        }
        .gb_item
        {
            background-color: #ffffff;
            border: solid 1px #cccccc;
            border-collapse: collapse;
            padding: 5px 5px 5px 5px;
        }
    </style>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="CPH_PageTitle" runat="server">
    留言管理
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="CPH_MainBody" runat="server">
    <fieldset>
        <legend>查询</legend>
        <table border="0" cellpadding="0" cellspacing="0" class="query_table">
            <tr>
                <td class="query_title">
                    类型：
                </td>
                <td class="query_content">
                    <asp:DropDownList runat="server" ID="ddl_Type">
                    </asp:DropDownList>
                </td>
                <td class="query_title">
                    审核：
                </td>
                <td class="query_content">
                    <asp:DropDownList runat="server" ID="ddl_Verify">
                        <asp:ListItem Value="">-全部-</asp:ListItem>
                        <asp:ListItem Value="1">通过</asp:ListItem>
                        <asp:ListItem Value="0">未通过</asp:ListItem>
                    </asp:DropDownList>
                </td>
                <td class="query_title">
                    搜索内容：
                </td>
                <td class="query_content">
                    <asp:TextBox ID="txt_Content" runat="server" MaxLength="50"></asp:TextBox>
                </td>
                <td class="query_title">
                    留言者姓名：
                </td>
                <td class="query_content">
                    <asp:TextBox ID="txt_Name" runat="server" MaxLength="50"></asp:TextBox>
                </td>
                <td class="query_title">
                    回复：
                </td>
                <td class="query_content">
                    <asp:RadioButtonList runat="server" ID="rbl_Reply" RepeatDirection="Horizontal">
                        <asp:ListItem Value="" Selected="True">全部</asp:ListItem>
                        <asp:ListItem Value="0">未回复</asp:ListItem>
                        <asp:ListItem Value="1">已回复</asp:ListItem>
                    </asp:RadioButtonList>
                </td>
            </tr>
        </table>
    </fieldset>
    <div class="action_bar">
        <asp:Button ID="btn_Query" runat="server" Text="查询" OnClick="btn_Query_Click" />
    </div>
    <fieldset>
        <legend>留言列表</legend>
        <asp:GridView ID="gvList" runat="server" AutoGenerateColumns="false" CssClass="GridView"
            DataKeyNames="GbKey" AllowPaging="True" PageSize="20" ShowHeader="false" PagerSettings-Mode="Numeric"
            OnPageIndexChanging="gvList_PageIndexChanging" OnRowCommand="gvList_RowCommand">
            <Columns>
                <asp:TemplateField>
                    <ItemTemplate>
                        <table>
                            <tr>
                                <td colspan="2" align="left">
                                    <asp:LinkButton runat="server" ID="lbtn_reply" CommandName="Reply" CommandArgument='<%# DataBinder.Eval(Container, "DataItem.GbKey") %>'>修改或回复</asp:LinkButton>
                                    |
                                    <asp:LinkButton runat="server" ID="lbtn_Verify" CommandName="Verify" CommandArgument='<%# DataBinder.Eval(Container, "DataItem.GbKey") %>'>通过审核</asp:LinkButton>
                                    |
                                    <asp:LinkButton runat="server" ID="lbtn_del" OnClientClick="return confirm('确定要删除?');"
                                        CommandName="Del" CommandArgument='<%# DataBinder.Eval(Container, "DataItem.GbKey") %>'>删除</asp:LinkButton>
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    时间：
                                </td>
                                <td>
                                    <%# DataBinder.Eval(Container, "DataItem.LastDate") %>
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    类型：
                                </td>
                                <td>
                                    <%# DataBinder.Eval(Container, "DataItem.TypeName") %>
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    留言人：
                                </td>
                                <td>
                                    <%# DataBinder.Eval(Container, "DataItem.Poster") %>
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    Email：
                                </td>
                                <td>
                                    <%# DataBinder.Eval(Container, "DataItem.PosterEmail") %>
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    Tel：
                                </td>
                                <td>
                                    <%# DataBinder.Eval(Container, "DataItem.PosterTel") %>
                                </td>
                            </tr>
                        </table>
                    </ItemTemplate>
                    <ItemStyle Width="190px" />
                </asp:TemplateField>
                <asp:TemplateField>
                    <ItemTemplate>
                        <div style="border-bottom:1px dotted #cccccc;">
                            <table>
                                <tr>
                                    <td>审核状态：</td>
                                    <td><div style="float:left;" class='sign_yn<%# DataBinder.Eval(Container, "DataItem.IsVerified") %>'></div></td>
                                    <td>审核人：</td>
                                    <td><%# DataBinder.Eval(Container, "DataItem.VerifyOperator") %></td>
                                    <td>审核时间：</td>
                                    <td><%# DataBinder.Eval(Container, "DataItem.VerifyDate") %></td>
                                </tr>
                            </table>
                        </div>
                                    
                        <div class="gb_content">
                            <%# DataBinder.Eval(Container, "DataItem.Content") %>
                        </div>
                        <div class="interval">
                        </div>
                        <div class="gb_reply">
                            回复：<%# DataBinder.Eval(Container, "DataItem.Reply") %></div>
                    </ItemTemplate>
                    <ItemStyle VerticalAlign="Top" />
                </asp:TemplateField>
            </Columns>
            <PagerTemplate>
                <asp:LinkButton ID="lbnFirst" runat="Server" Text="首页" Enabled='<%# ((GridView)Container.NamingContainer).PageIndex != 0 %>'
                    CommandName="Page" CommandArgument="First"></asp:LinkButton>
                <asp:LinkButton ID="lbnPrev" runat="server" Text="上一页" Enabled='<%# ((GridView)Container.NamingContainer).PageIndex != 0 %>'
                    CommandName="Page" CommandArgument="Prev"></asp:LinkButton>
                <asp:Label ID="lblPage" runat="server" Text='<%# "第" + (((GridView)Container.NamingContainer).PageIndex + 1)  + "页/共" + (((GridView)Container.NamingContainer).PageCount) + "页" %> '></asp:Label>
                <asp:LinkButton ID="lbnNext" runat="Server" Text="下一页" Enabled='<%# ((GridView)Container.NamingContainer).PageIndex != (((GridView)Container.NamingContainer).PageCount - 1) %>'
                    CommandName="Page" CommandArgument="Next"></asp:LinkButton>
                <asp:LinkButton ID="lbnLast" runat="Server" Text="尾页" Enabled='<%# ((GridView)Container.NamingContainer).PageIndex != (((GridView)Container.NamingContainer).PageCount - 1) %>'
                    CommandName="Page" CommandArgument="Last"></asp:LinkButton>
            </PagerTemplate>
            <HeaderStyle CssClass="GridViewHeader" />
            <RowStyle CssClass="GridViewRow" />
            <FooterStyle CssClass="GirdViewFooter" />
            <PagerStyle CssClass="GridViewPager" />
            <EmptyDataRowStyle CssClass="GridViewEmptyDataRow" />
            <EmptyDataTemplate>
                没有可用的数据</EmptyDataTemplate>
        </asp:GridView>
    </fieldset>
</asp:Content>
